using System;
using Microsoft.Practices.Composite.Events;
using StockholmsStad.Windows.UI.Modules.Minister.Interfaces;
using StockholmsStad.Windows.UI.Modules.Minister.Models;

namespace StockholmsStad.Windows.UI.Modules.Minister.Presenters
{
    public class MinisterListPresenter : IMinisterListPresenter
    {
        public event EventHandler<DataEventArgs<MinisterPresentationModel>> MinisterSelected = delegate { };

        public MinisterListPresenter(IMinisterListView view, IMinisterService ministerService)
        {
            View = view;
            View.MinisterSelected += ((sender, e) => MinisterSelected(sender, e));
            view.Model = ministerService.GetMinisters();
        }

        public IMinisterListView View { get; set; }
    }
}
